#ifndef SWEEP_DEFS

#define SWEEP_DEFS

#include "heap.h"
#include "link.h"
#include "geometry.h"
#include "polygon.h"
#include "voronoi.h"

#define SweepLimits	10000

#ifdef __cplusplus
extern "C" {
#endif

extern boolean showSpokes;
extern boolean showVoronoiEdges;
extern boolean showBottleneck;
extern boolean showVoronoiVertices;
extern boolean showDebugInfo;
extern boolean showSweepSpokes;
extern boolean showFrontPierce;
extern boolean showSweepFront;
extern boolean showPolygons;
extern boolean showAllFrontPierce;
extern boolean jumpSweep;
extern boolean autoDebug;
extern boolean permitStep;
extern boolean useFast;
extern boolean demoPass;
extern boolean halting;
extern boolean inSweep;
extern int	   haltCount;
extern int	   haltLimit;
extern int	   haltMajorCount;
extern int	   haltMajorLimit;

extern boolean dumpVorVertices;
extern boolean dumpVorOrder;

typedef struct {
	Pt			eventPt;
	Pt			eventCentre;
	spokeInfo	midSpoke;
	Pgon		*poly[3];
	link_node	*frontArcs[3];
	}	scheduleInfo;

#define VorListSize	20

typedef struct _front {
	Pgon		*generator;
	HEAP_HeapId		deathRef;
	HEAP_HeapId		atTopRef, atBottomRef;
	spokeInfo	spoke;
	Line		lineThroughFrontArc;
	struct _front *prev, *next;
	int			topCount, bottomCount;
	int			topVor[VorListSize], bottomVor[VorListSize];
	}	frontInfo;
	
void sweep (Pgon *polyList[], int numPoly, int delayCoeff);
void redrawSweepStatus();
void hightlightSites();

#ifdef __cplusplus
}
#endif

#endif
